package CaclulateWord;

import java.util.Scanner;
//计算单词数目
public class Solution {
    public static int countWord(String s){
        int count = 0;
        for (int i = 0; i < s.length(); i++) {
          char ch = s.charAt(i);
          if((i == 0||s.charAt(i-1) ==' ')&& s.charAt(i)!=' '){
              count++;
          }
        }
        return count;
    }

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String s = scanner.nextLine();
        System.out.println(countWord(s));
    }
}
